//
// CWaterEnvMapUser.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CWaterEnvMapUser extends UWaterEnvMap {
  private long swigCPtr;

  public CWaterEnvMapUser(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CWaterEnvMapUser_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CWaterEnvMapUser obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CWaterEnvMapUser(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setEnvMap(SWIGTYPE_p_NL3D__CWaterEnvMapUser__CWaterEnvMapInternal value) {
    nel3dJNI.CWaterEnvMapUser_EnvMap_set(swigCPtr, this, SWIGTYPE_p_NL3D__CWaterEnvMapUser__CWaterEnvMapInternal.getCPtr(value));
  }

  public SWIGTYPE_p_NL3D__CWaterEnvMapUser__CWaterEnvMapInternal getEnvMap() {
    long cPtr = nel3dJNI.CWaterEnvMapUser_EnvMap_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_NL3D__CWaterEnvMapUser__CWaterEnvMapInternal(cPtr, false);
  }

  public void init(long cubeMapSize, long projection2DSize, double updateTime) {
    nel3dJNI.CWaterEnvMapUser_init(swigCPtr, this, cubeMapSize, projection2DSize, updateTime);
  }

  public void setWaterEnvMapRenderCallback(IWaterEnvMapRender rdr) {
    nel3dJNI.CWaterEnvMapUser_setWaterEnvMapRenderCallback(swigCPtr, this, IWaterEnvMapRender.getCPtr(rdr), rdr);
  }

  public IWaterEnvMapRender getWaterEnvMapRenderCallback() {
    long cPtr = nel3dJNI.CWaterEnvMapUser_getWaterEnvMapRenderCallback(swigCPtr, this);
    return (cPtr == 0) ? null : new IWaterEnvMapRender(cPtr, false);
  }

  public void invalidate() {
    nel3dJNI.CWaterEnvMapUser_invalidate(swigCPtr, this);
  }

  public void setAlpha(short alpha) {
    nel3dJNI.CWaterEnvMapUser_setAlpha(swigCPtr, this, alpha);
  }

  public short getAlpha() {
    return nel3dJNI.CWaterEnvMapUser_getAlpha(swigCPtr, this);
  }

  public CWaterEnvMap getWaterEnvMap() {
    long cPtr = nel3dJNI.CWaterEnvMapUser_getWaterEnvMap(swigCPtr, this);
    return (cPtr == 0) ? null : new CWaterEnvMap(cPtr, false);
  }

}
